import http from './http'

export function login(params) {
  return http.post('/manage-api/v1/adminUser/login', params)
}
export function logout() {

  return http({
    method: 'DELETE',
    url: '/manage-api/v1/logout'
  }).then(data => {
    localStorage.removeItem('xf_project_token')
    return data
  })
}

export function getProfile() {
  return http.get('/manage-api/v1/adminUser/profile')
}

export function getCarousels(params) {
  return http.get('/manage-api/v1/carousels', {
    params
  })
}
export function setCarousels(data, method = 'put') {
  return http({
    method: method,
    url: '/manage-api/v1/carousels',
    data: data
  })
}